﻿using Red.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Red.Toolkit.MeshEditor.ViewModels
{

    public class LodDescriptionViewModel : ViewModel
    {
        #region Data

        private double _reduction;
        private double _distance;
        private int _chunksLimit;
        private int _selectedLod;

        #endregion

        #region Properties

        public double ReductionFactor
        {
            get { return _reduction; }
            set
            {
                if ( value != _reduction )
                {
                    _reduction = value;
                    OnPropertyChanged();
                }
            }
        }
        public double Distance
        {
            get { return _distance; }
            set
            {
                if ( value != _distance )
                {
                    _distance = value;
                    OnPropertyChanged();
                }
            }
        }

        public int ChunksLimit
        {
            get { return _chunksLimit; }
            set
            {
                if ( value != _chunksLimit )
                {
                    _chunksLimit = value;
                    OnPropertyChanged();
                }
            }
        }

        public int SelectedLod
        {
            get { return _selectedLod; }
            set
            {
                if ( value != _selectedLod )
                {
                    _selectedLod = value;
                    OnPropertyChanged();
                }
            }
        }

        #endregion

        #region C-tor

        public LodDescriptionViewModel()
        {
            ReductionFactor = 0.5;
            Distance = 15.0;
            ChunksLimit = 0;
            SelectedLod = -1;
        }

        public LodDescriptionViewModel( double reduction, double distance, int chunksimit, int selectedLod = -1 )
        {
            ReductionFactor = reduction;
            Distance = distance;
            ChunksLimit = chunksimit;
            SelectedLod = selectedLod;
        }

        public LodDescriptionViewModel( LodDescriptionViewModel lodDesc )
        {
            ReductionFactor = lodDesc.ReductionFactor;
            Distance = lodDesc.Distance;
            ChunksLimit = lodDesc.ChunksLimit;
            SelectedLod = lodDesc.SelectedLod;
        }

        #endregion
    }
}
